import React, { Component } from 'react'
import { inject, observer } from 'mobx-react';
import { Toast, ListView, Picker, Flex, Tabs } from 'antd-mobile'
import { createForm } from 'rc-form';
import Top2 from 'components/top2'
import Ajax from 'lib/Ajax'
import Msg from 'mixin/msg'

const TabPane = Tabs.TabPane;
const pageName = 'schoolMsg';

@inject('appStore', 'languageStore')
@observer
class ModuleName extends Msg {
	constructor(props) {
    super(props);
		this.searchOption = {
			schoolId: this.props.params.id
		}
		this.msgApi = '/school/get';
  }

  render() {
    const pageData = this.props.languageStore.getPageData(pageName);
    const { coverImg, introduction, requireStr, name, listImg, qsRank } = this.state.msgData;
    const { imgBaseUrl } = this.props.appStore;
    return (
    	<div className={pageName}>
        <Top2 />
        <div className={`${pageName}-Content`}>
          <div className="school-temp">
            <div className="top">
              <img src={`${imgBaseUrl}${coverImg}`} alt="" className="coverImg" />
              <div className="b-s">
                <h3><img src={`${imgBaseUrl}${listImg}`} alt="" className="listImg" />{ name }</h3>
                <div className="desc">
                  QS排名：{qsRank}
                </div>
              </div>
            </div>
            <Tabs defaultActiveKey="1">
              <TabPane tab="要求" key="1" swipeable={false}>
                <div className="tab-inner">
                  <div className="blank" style={{height: '.2rem'}}></div>
                  <div className="msg" dangerouslySetInnerHTML={{__html: requireStr}}></div>
                </div>
              </TabPane>
              <TabPane tab="简介" key="2">
                <div className="tab-inner">
                  <div className="blank" style={{height: '.2rem'}}></div>
                  <div className="msg" dangerouslySetInnerHTML={{__html: introduction}}></div>
                </div>
              </TabPane>
            </Tabs>
          </div>
        </div>
    	</div>
    )
  }
}

module.exports = ModuleName
